package service.WorkManagement;

import entity.Employment;
import entity.JobTendency;
import entity.WorkExp;
import mapper.WorkManagement.WorkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashMap;
import java.util.List;

@Service
public class WorkService {
    @Autowired
    private WorkMapper workMapper;

    public boolean addWorkExp(WorkExp workExp) {
        return workMapper.addWorkExp(workExp) == 1;
    }

    public int findExpIdByTimeAndUserId(String Time, String userId) {
        return workMapper.findExpIdByTimeAndUserId(Time, userId);
    }

    public LinkedHashMap<String, Object> findOneWorkExpByExpId(String expId) {
        return workMapper.findOneWorkExpByExpId(expId);
    }

    public boolean addJobTendency(JobTendency jobTendency){
        return  workMapper.addJobTendency(jobTendency) == 1;
    }

    public int findTendencyIdByTimeAndUserId(String Time,String userId){
        return workMapper.findTendencyIdByTimeAndUserId(Time,userId);
    }

    public LinkedHashMap<String,Object> findOneJobTendencyByExpId(String TendencyId){
        return workMapper.findOneJobTendencyByExpId(TendencyId);
    }

    public List<WorkExp> showWorkExp(String userId){
        return workMapper.showWorkExp(userId);
    }

    public List<JobTendency> showJobTendency(String userId){
        return workMapper.showJobTendency(userId);
    }

    public boolean addRecruit(Employment employment){
        return workMapper.addEmployment(employment) == 1;
    }

    public String findEmploymentId(String enterpriseId,String insertTime){
        return workMapper.findEmploymentId(enterpriseId,insertTime);
    }

    public LinkedHashMap<String,Object> findOneRecruitById(String Id){
        return workMapper.findOneRecruitById(Id);
    }
}
